//
//  RadioDetailListTableViewController.m
//  SuiRan
//
//  Created by lanou3g on 15-4-29.
//  Copyright (c) 2015年 蓝鸥科技. All rights reserved.
//

#import "RadioDetailListTableViewController.h"
#import "RadioDetailListTableViewCell.h"
#import "RadioCollectionViewController.h"
#import "RadioDetail.h"
#import "AFHTTPRequestOperationManager.h"
#import "Moreting.h"
#import "Userinfo.h"
#import "RadioDetailContactViewController.h"
#import "AudioPlayer.h"



@interface RadioDetailListTableViewController ()


@property (nonatomic, retain) NSMutableArray *usetinfoArray;
@end

@implementation RadioDetailListTableViewController

static NSString * const reuseIdentifier = @"radioDetailListTableViewCell";






- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self.tableView registerNib:[UINib nibWithNibName:@"RadioDetailListTableViewCell" bundle:nil] forCellReuseIdentifier:reuseIdentifier];
//    NSLog(@"??????????????%@", _tingid);
    
    
    
    
}




#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    
    return 1;
    
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    return _getDataArray2.count;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    RadioDetailListTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:reuseIdentifier forIndexPath:indexPath];
    Moreting *m = _getDataArray2[indexPath.row];
    cell.titleLabel.text = m.title;
    NSString *uname = _getUnameArray2[indexPath.row];
    cell.authorLabel.text = [NSString stringWithFormat:@"by:%@", uname];
    
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 60.f;
}


- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    RadioDetailContactViewController *rdcVC = [[RadioDetailContactViewController new] autorelease];
    
    
    
    rdcVC.tingid0 = _tingid;
    
    [[AudioPlayer ShowInstance].streamer stop];
    [self.navigationController pushViewController:rdcVC animated:YES];
}


- (void)dealloc
{
    [_tingid release];
    [_getDataArray2 release];
    [_getUnameArray2 release];
    [_usetinfoArray release];
    
    [super dealloc];
}

@end
